home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-02-17 | 4.7 KB | 156 lines | [TEXT/KAHL] |
- /*************************************************************************
-
- FLOATING WINDOW 1.3
-
- *************************************************************************
-
- COPYRIGHT © 1991 THE UNKNOWN SOFTWARE GROUP. ALL RIGHTS RESERVED.
-
- Questions, comments, etc.
-
- To: Patrick Doane
- 89 Fair Street.
- Guilford, CT 06437
-
- America-On-Line: Patrick5
-
- Phone: (203) 458-9936
-
- *************************************************************************/
-
- With version 1.3, I believe the system is finally perfect. Although you
- may experience a few things wrong at first, with a little fiddling it
- does work.
- If for some reason you find a technique that doesn't work and you feel
- support should be added for it, contact me.
-
-
-
- CREATION OF NEW WINDOWS:
-
- /* Note the fact the I use the behindWindow parameter as OL. It is
- essential that this is added or the entire system will fail. If you pass
- -1L as which is normally done, it will place the window in front of the
- floating windows which will cause the floating window to get lost in
- the crowd of windows. */
-
- theWindow = GetNewWindow(128,0L,0L);
-
- /* Then call SelectTheWindow when you want to make your window visible.
- SelectTheWindow will take care of where the window will become visible
- within the window list and make it appear below all other floating
- windows. */
-
- SelectTheWindow(theWindow);
-
-
- If you find a way which you think should work that doesn't, drop me a note
- and I'll see what I can do to make sure it does.
-
- You may also find a little problem with the handling of DA windows. The
- routine, UpdateTopWindow() must be called after OpenDeskAcc() and
- SystemClick();
-
-
- EXPLANATIONS OF ROUTINES:
-
- void InitFloat(void);
-
- InitFloat should be called when your application is started up. Usually
- right after you have initialized other toolbox managers. The program
- will likely crash if you use floating windows without calling
- InitFloat();
-
- void UpdateTopWindow(void);
-
- An internal routine used to update the top non-floating window.
- Normally, you will have no need to call it yourself except where
- DA's are involved.
-
- void UpdateFloats(void);
-
- Another internal routine used to update the floating window variables
- topFloat and bottomFloat. It scans through the list setting these
- variables to their appropriate values.
-
- WindowPtr NewFloatingWindow(short ResID,Ptr wStorage);
-
- Create a new floating window. It will bring the window the front
- and make it the new top floating window.
-
- void MakeFloating(WindowPtr whichWindow);
-
- Marks a window as a floating window and makes sure it is visible.
-
- Boolean IsFloating(WindowPtr whichWindow);
-
- Tests to see if a window is a floating window.
-
- void CloseTheWindow(WindowPtr whichWindow);
-
- Replacement routine for toolbox routine CloseWindow. Will correctly
- activate the next visible window and update the floating windows.
-
- void DisposeTheWindow(WindowPtr whichWindow);
-
- Replacement routine for toolbox routine DisposeWindow. Will correctly
- activate the next visible window and update the floating windows.
-
- void ShowTheWindow(WindowPtr whichWindow);
-
- Replacement routine for toolbox routine DisposeWindow. Hilites the
- window if necessary.
-
- void HideTheWindow(WindowPtr whichWindow);
-
- Replacement routine for toolbox routine DisposeWindow. Hilites
- another window if necessary.
-
- void ShowFloats(void);
-
- ShowFloats will make all the floating windows visible. This routine
- should be called in response to a Resume Event.
-
- void HideFloats(void);
-
- HideWindows will make all the floating windows invisible. This routine
- should be called in response to a Suspend Event.
-
- WindowPtr CurrentWindow(void);
-
- Replacement routine for toolbox routine FrontWindow. It returns the
- internal variable topWindow.
-
- void SelectTheWindow(register WindowPtr whichWindow);
-
- Replacement routine for toolbox routine SelectWindow. If the window
- is a floating window, it brings it to the front. Otherwise it brings
- it behind the bottommost floating window.
-
- void DragTheWindow(WindowPtr whichWindow,EventRecord *theEvent);
-
- Replacement routine for toolbox routine DragWindow. It will not bring
- the window to the front as does DragWindow and will also correctly
- set up the drag region.
-
- void CalcWindowVis(register WindowPeek whichWindow);
-
- Internal routine used for the calculation of a windows visible region.
-
- void GlobalRgn(register RgnHandle changeRgn);
-
- Handy utility which converts a region to global coordinates.
-
- void LocalRgn(register RgnHandle changeRgn);
-
- Handy utility which converts a region to local coordinates.
-
-
- PROGRAM CHANGES
-
- Sometimes it is necessary to call UpdateTopWindow when you have DA's
- running. Below is a list of occurences that may cause the topWindow
- global variable to become invalid.
-
- - MouseDown in a system window (DA)
- - Launching a DA